<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //创建一个对象
        var o = new Object();
        //给对象添加属性与属性值
        o.name = "文渊";
        o.gender = "男";
        o.sex = 18;
        /* 添加方法 */
        o.eat = function () {
            console.log(o.name + "正在吃东西");
        }
        console.log(o);
    </script>
</body>

</html>